#pragma once

#include <memory>
#include <string>

#include "stream/IOpenable.h"

namespace stream {

class Topic;
class Reader : public IOpenable{
public:

    typedef std::shared_ptr<std::string> record_type;
    
	Reader(std::shared_ptr<Topic> topic);

	virtual ~Reader(){}
	
	virtual bool hasNext() const = 0;
	virtual record_type current() const = 0;
	virtual void next() = 0;

	virtual std::shared_ptr<Topic> topic() const;

protected:
	std::shared_ptr<Topic> _topic;
};

Reader * makeReader(std::shared_ptr<Topic> topic, size_t offset);
Reader * makeReaderMock(std::shared_ptr<Topic> topic, size_t offset);

}//end namespace stream
